/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package group2assignone.ucm.manager;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import group2assignone.view.manager.*;
import group2assignone.model.GSTax;
import group2assignone.ucm.UCController;

/**
 *
 * @author Brad
 */
class UCEditGSTSave implements UCController {

    private GSTax tax;
    private EditGSTView view;

    UCEditGSTSave(EditGSTView view, GSTax tax) {
        this.tax = tax;
        this.view = view;

    }

    public void run() {
        // tax.setGST(view.getInput());
        if (view.getInput().length() > 0) {
            int val = Integer.parseInt(view.getInput());

                tax.setGST(val);
                view.dispose();
                ManagerView mv = ManagerView.getInstance();
                mv.setVisible(true);

            
        } else {
            System.err.println(" invalid gst");
        }


    }
}
